﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Task.Quartz
{
    /// <summary>
    /// 作业参数实体
    /// </summary>
    public class QJobEntity
    {
        //不变参数
        public string SysCode { get; set; }
        public string JobId { get; set; }
        public string Name { get; set; }
        public string Group { get; set; }
        public JobState State { get; set; }
        public JobAction Action { get; set; }

        //执行参数
        public int Seconds { get; set; }
        public int MaxTimes { get; set; }
        public string WithCronSchedule { get; set; }
        public DateTime StartTime { get; set; }
        public int Times { get; set; }
        public DateTime LastTime { get; set; }

        /// <summary>
        /// 动态参数实体
        /// </summary>
        [System.Xml.Serialization.XmlIgnore]
        public Entity.Config.HandlerConfig HandlerConfig { get; set; }

        public void SetJobEntity(QJobEntity jobEntity)
        {
            Seconds = jobEntity.Seconds;
            MaxTimes = jobEntity.MaxTimes;
            WithCronSchedule = jobEntity.WithCronSchedule;
            StartTime = jobEntity.StartTime;
            Times = jobEntity.Times;
            LastTime = jobEntity.LastTime;
            HandlerConfig = jobEntity.HandlerConfig;
        }

    }
}
